﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Markup;

namespace UIT.Controls.Template
{
    [ContentProperty("Template")]
    public class ControlTemplate : ITemplate
    {
        #region ITemplate Members

        public TemplateContent Template
        {
            get;
            set;
        }

        public string ContainerName { get; set; }

        public IControl CreateInstance(object context)
        {
            IControl template = Template.CreateInstance();
            template.DataContext = context;
            return template;
        }

        #endregion

        #region ITemplate Members


        public object Metadata
        {
            get;
            set;
        }

        #endregion

        #region ITemplate Members


        public bool IsBoundTemplate
        {
            get { return false; }
        }

        #endregion
    }
}
